import { AnotherInfoItem } from './data.d';

function getExpressAnother(
  req: { url: any },
  res: {
    json: (
      arg0: { body: AnotherInfoItem },
    ) => void;
  },
  u: any,
) {
  let new_url = u;
  if (!new_url || Object.prototype.toString.call(new_url) !== '[object String]') {
    new_url = req.url;
  }

  const dataSource: AnotherInfoItem = {
    youzheng: 'youzheng',
    yuantongkuaidi: 'yuantongkuaidi',
    tiantiankuaidi: 'tiantiankuaidi',
    zhaijisong: 'zhaijisong',
    ems: 'ems',
    shentongkuaidi: 'shentongkuaidi',
  };

  const result = {
    code: 0,
    body: dataSource,
  };

  return res.json(result);
}

export default {
  'GET /express/expressAnother': getExpressAnother,
};
